﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jamhee.Noctiluca.LightWiki.Markup
{
    interface IMarkupStackFlag
    {
    }

    abstract class MarkupStackFlag : IMarkupStackFlag
    {
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj is MarkupStackFlag)
            {
                return this.ToString().Equals(obj.ToString());
            }

            return false;
        }

        public override string ToString()
        {
            return this.GetType().ToString();
        }
    }


    class ListStackFlag : MarkupStackFlag
    {
        private ListType _type;
        private int _level;

        public enum ListType
        {
            ORDERED,
            UNORDERED
        }

        public ListStackFlag(ListType type, int level)
        {
            this._level = level;
            this._type = type;
        }

        public int CompareTo(ListStackFlag list)
        {
            return this._level.CompareTo(list._level);
        }

        public override string ToString()
        {
            return this.GetType().ToString() + "[TYPE=" + this._type + ";LEVEL=" + this._level + "]";
        }

        public ListType Type
        {
            get { return this._type; }
        }

        public int Level
        {
            get { return this._level; }
        }
    }


}
